function destroyVue() {
    this.$destroy();
    document.removeEventListener('turbolinks:before-cache', destroyVue.bind(this))
}

var TurbolinksAdapter = {
    beforeMount: function(){
        if (this.$el.parentNode) {
            document.addEventListener('turbolinks:before-cache', destroyVue.bind(this))
            this.$originalEl = this.$el.outerHTML;
        }
    },
    destroyed: function() {
        this.$el.outerHTML = this.$originalEl;
    }
};
Vue.http.headers.common['X-CSRF-Token'] = document.querySelector('meta[name="csrf-token"]').getAttribute('content')

// new Vue().$http.post('/base/users',{base_user:{name_cn:'xxxx2',username:'xia'}}).then(function(a){Turbolinks.visit(`/base/users/${a.body.id}`)},function(b){console.log('b',b)})
// new Vue({mixin: [TurbolinksAdapter]})